package object;

import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Queue;

public class Test2 {
    public static void main(String[] args) {
        Queue<Integer> queue = new LinkedList<>();
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        queue.offer(4);
        System.out.println(queue);
        queue.poll();
        System.out.println(queue);
        int s = queue.peek();
        System.out.println(s);
//        if(queue.isEmpty()){
//            System.out.println("队列为空");
//        } else {
//            System.out.println("不为空");
//        }
        if(queue.peek() != null){
            System.out.println("队列不为空");
        }

    }
}
